package com.dirox.jira.notes.utils;

import com.dirox.jira.notes.entities.Note;
import java.util.Comparator;


public class NoteComparator implements Comparator<Note> {
	@Override
	public int compare(Note note1, Note note2) {
		if (note1.getPriority() < note2.getPriority()) {
			return 1;
		} else if (note1.getPriority() > note2.getPriority()) {
			return -1;
		} else {
			return ((note1.getID() > note2.getID())
			        ? 1
			        : (-1));
		}
	}
}
